<template>
    <a-card style="margin-top: 24px" :bordered="false" title="求职者信息">
      <a-list size="large" :pagination="pagination">
        <a-list-item :key="index" v-for="(item, index) in data">
          <a-list-item-meta :description="`留言：${item.seeker_talk}`">
            <!-- <a-avatar slot="avatar" size="large" shape="square" :src="item.avatar" /> -->
            <a slot="title">职位：{{ item.seeker_job }}</a>
          </a-list-item-meta>
          <div slot="actions">
            <a @click="call(item)">邮箱：{{item.seeker_email}}</a>
          </div>
          <!-- <div slot="actions">
            <a-dropdown>
              <a-menu slot="overlay">
                <a-menu-item><a>{{item.}}</a></a-menu-item>
                <a-menu-item><a>删除</a></a-menu-item>
              </a-menu>
              <a>更多
                <a-icon type="down" /></a>
            </a-dropdown>
          </div> -->
          <div class="list-content">
            <div class="list-content-item">
              <span>手机号：{{item.seeker_phone}}</span>
              <p>姓名：{{ item.seeker_name }}</p>
            </div>
            <div class="list-content-item">
              <span>提交时间</span>
              <p>{{ item.creat_time }}</p>
            </div>
            <div class="list-content-item">
              <!-- <a-progress :percent="item.progress.value" :status="!item.progress.status ? null : item.progress.status"
                style="width: 180px" /> -->
            </div>
          </div>
        </a-list-item>
      </a-list>
    </a-card>
</template>

<script>
  import TaskForm from './modules/TaskForm'
  import Info from './components/Info'
import {recruitmentList} from  '@/api/recruitment.js'
  export default {
    name: 'recruitment',
    components: {
      TaskForm,
      Info
    },
    data () {
      return {
        data:[],
        status: 'all',
		pagination: {
			showSizeChanger: true,
			pageSizeOptions: ['10', '20', '50'],
			current:1,
			pageSize: 10,
			total:0,
			onChange:(current, size)=>{
				this.pagination.current = current;
				this.pagination.pageSize = size;
				this.getList()
			},
			onShowSizeChange:(current, size)=>{
				this.pagination.current = current;
				this.pagination.pageSize = size;
				this.getList()
			}
		},
      }
    },
	mounted(){
		this.getList()
	},
    methods: {
		getList(){
			recruitmentList({page:this.pagination.current,size:this.pagination.pageSize}).then(res=>{
				this.data = res.data.list;
				this.pagination.total = res.data.total
			})
		},
      add () {
        this.$dialog(TaskForm,
          // component props
          {
            record: {},
            on: {
              ok () {
                console.log('ok 回调')
              },
              cancel () {
                console.log('cancel 回调')
              },
              close () {
                console.log('modal close 回调')
              }
            }
          },
          // modal props
          {
            title: '新增',
            width: 700,
            centered: true,
            maskClosable: false
          })
      },
      edit (record) {
        console.log('record', record)
        this.$dialog(TaskForm,
          // component props
          {
            record,
            on: {
              ok () {
                console.log('ok 回调')
              },
              cancel () {
                console.log('cancel 回调')
              },
              close () {
                console.log('modal close 回调')
              }
            }
          },
          // modal props
          {
            title: '操作',
            width: 700,
            centered: true,
            maskClosable: false
          })
      }
    }
  }
</script>

<style lang="less" scoped>
.ant-avatar-lg {
    width: 48px;
    height: 48px;
    line-height: 48px;
}

.list-content-item {
    color: rgba(0, 0, 0, .45);
    display: inline-block;
    vertical-align: middle;
    font-size: 14px;
    margin-left: 40px;
    span {
        line-height: 20px;
    }
    p {
        margin-top: 4px;
        margin-bottom: 0;
        line-height: 22px;
    }
}
</style>
